import {
  Column,
  Entity,
  OneToOne,
  JoinColumn,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { User } from './user.entity';

@Entity()
export class Profile {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ default: null })
  address: string;

  @Column({ default: null })
  nickname: string;

  @Column({ default: null })
  phone: string;

  @Column({ default: null })
  sex: string;

  @Column({ default: null })
  email: string;

  @Column({ type: 'enum', enum: ['0', '1'], default: '1' })
  status: string;

  @Column({ default: null })
  brief: string;

  @Column({ default: null })
  avatar: string;

  @OneToOne(() => User, (user) => user.profile)
  @JoinColumn()
  user: User;
}
